package protocol;

import server.NodeInfo;

public class AttachingNodeException extends Exception {
	private static final long serialVersionUID = 1L;
	private NodeInfo info;
	private String errorDetails;
	
	public AttachingNodeException(NodeInfo info, String details) {
		this.info = info;
		this.errorDetails = details;
	}

	@Override
	public String getMessage() {	
		return "Adding new node error" + errorDetails + "\n" +
			   "Database name: " + info.getDbName() + "\n" + 
			   "Database server IP: " + info.getIP() + "\n";
	}
}
